#include <Arduino.h>
#include <EEPROM.h>
//#include <HardwareSerial.h>

//#define SerialPort Serial1
#ifndef _RMCS_MOTOR_H_
#define _RMCS_MOTOR_H_

class RmcsMotor
{
public:
	void attach(HardwareSerial *serialport); //Mega has 3 serial ports - Serial 0,1,2 - attach it on 1 or 2 only //0 is used for programming
	void rotateAbsolute(int degree); //rotates clockwise if degree is positive
	void rotateRelative(int degree);
	int getCurrentAngle();
	double getCurrentPosition(); 
	void setMaxSpeed(int speed); //in percent
	void setCurrentPositionAsMean();

        RmcsMotor();
private:
	char buffer[20];
	double currentposition;
	double meanposition;
        HardwareSerial *serialport;
};
#endif

	
